package com.mapaoer.user.repository;

import com.mapaoer.user.entity.Permission;

import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.Optional;

@Repository
public interface PermissionRepository extends BaseMapper<Permission> {
    
    /**
     * 根据权限名称查询权限
     */
    Optional<Permission> findByName(String name);
    
    /**
     * 根据权限标识查询权限
     */
    Optional<Permission> findByPermissionKey(String permissionKey);
    
    /**
     * 判断权限标识是否存在
     */
    boolean existsByPermissionKey(String permissionKey);
}